package day6

import org.apache.spark.sql.SparkSession

object Test1 {
  def main(args: Array[String]): Unit = {
    val spark = SparkSession.builder()
                                          .master("local[*]")
                                          .appName("ceshi1")
                                          .getOrCreate()

    val df = spark.read.json("file:///D:\\data\\a.json")
    // 打印DataFrame的表结构
    df.printSchema()
    // 输出表中的数据
    df.show()

    spark.stop()
  }
}
